package com.xinghuo.building.data.database

import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.xinghuo.building.App

@Database(entities = [Student::class], version = 1)
abstract class AppDataBase: RoomDatabase() {

    abstract fun getStudentDao(): StudentDao

    companion object {
        private const val DATABASE_NAME = "User.db"
        val instance = Room.databaseBuilder(
            App.instance(),
            AppDataBase::class.java,
            DATABASE_NAME
        ).allowMainThreadQueries()
            .fallbackToDestructiveMigration()
            .build()
    }


}
